#!/bin/bash

# decompression and jion the file
cat "$1"* | tar -jxv

# check md5
# if true, rm webdav files
# if false, print error.
if test -e verify.md5
then
    if md5sum -c --status verify.md5
    then
        echo "md5 Checked!"
        rm "$1"*
        rm verify.md5
    else
        echo "md5 wrong, file incomplete."
    fi
else
    echo "No md5 file exist."
fi
